package indi.zn.commons.simplepoi;

public class CellStyle implements Comparable<CellStyle> {

	private int xC;// coordinate cr 坐标
	private int yC;

	private Boolean font_Italic; // 设置字体为斜体字
	private Short font_Boldweight;// Font.BOLDWEIGHT_BOLD;
	private Short font_color;// Font.COLOR_RED;
	private Short font_FontHeightInPoints; // 22 字体大小
	private String font_FontName; // 字体
	private Byte font_Underline;// Font.U_DOUBLE;
	private Short cellAlignment;// XSSFCellStyle.ALIGN_CENTER
	private Short cellVerticalAlignment; // org.apache.poi.ss.usermodel.CellStyle.VERTICAL_CENTER;
	private Short[] cellBorders; // 上下左右
	private Short cellBackgroundColor;
	private Short[] cellBordersColor; // 上下左右
	private Boolean cellhiden;
	private Boolean cellWrapTex; // 自动换行

	public CellStyle(int x, int y) {
		this.xC = x;
		this.yC = y;
	}

	public Boolean getFont_Italic() {
		return font_Italic;
	}

	public void setFont_Italic(Boolean font_Italic) {
		this.font_Italic = font_Italic;
	}

	public Short getFont_Boldweight() {
		return font_Boldweight;
	}

	public void setFont_Boldweight(Short font_Boldweight) {
		this.font_Boldweight = font_Boldweight;
	}

	public Short getFont_color() {
		return font_color;
	}

	public void setFont_color(Short font_color) {
		this.font_color = font_color;
	}

	public Short getFont_FontHeightInPoints() {
		return font_FontHeightInPoints;
	}

	public void setFont_FontHeightInPoints(Short font_FontHeightInPoints) {
		this.font_FontHeightInPoints = font_FontHeightInPoints;
	}

	public String getFont_FontName() {
		return font_FontName;
	}

	public void setFont_FontName(String font_FontName) {
		this.font_FontName = font_FontName;
	}

	public Byte getFont_Underline() {
		return font_Underline;
	}

	public void setFont_Underline(Byte font_Underline) {
		this.font_Underline = font_Underline;
	}

	public Short getCellAlignment() {
		return cellAlignment;
	}

	public void setCellAlignment(Short cellAlignment) {
		this.cellAlignment = cellAlignment;
	}

	public Short getCellVerticalAlignment() {
		return cellVerticalAlignment;
	}

	public void setCellVerticalAlignment(Short cellVerticalAlignment) {
		this.cellVerticalAlignment = cellVerticalAlignment;
	}

	public Short[] getCellBorders() {
		return cellBorders;
	}

	public void setCellBorders(Short[] cellBorders) {
		this.cellBorders = cellBorders;
	}

	public Short getCellBackgroundColor() {
		return cellBackgroundColor;
	}

	public void setCellBackgroundColor(Short cellBackgroundColor) {
		this.cellBackgroundColor = cellBackgroundColor;
	}

	public Short[] getCellBordersColor() {
		return cellBordersColor;
	}

	public void setCellBordersColor(Short[] cellBordersColor) {
		this.cellBordersColor = cellBordersColor;
	}

	public Boolean getCellhiden() {
		return cellhiden;
	}

	public void setCellhiden(Boolean cellhiden) {
		this.cellhiden = cellhiden;
	}

	public Boolean getCellWrapTex() {
		return cellWrapTex;
	}

	public void setCellWrapTex(Boolean cellWrapTex) {
		this.cellWrapTex = cellWrapTex;
	}

	public int getxC() {
		return xC;
	}

	public void setxC(int xC) {
		this.xC = xC;
	}

	public int getyC() {
		return yC;
	}

	public void setyC(int yC) {
		this.yC = yC;
	}

	@Override
	public int compareTo(CellStyle o) {
		// TODO Auto-generated method stub
		int r = 0;

		if (this.yC > o.yC) {
			r = 1;
		}

		if (this.yC < o.yC) {

			r = -1;
		}
		if (this.yC == o.getyC()) {

			if (this.xC == o.getxC()) {
				r = 0;
			}
			if (this.xC > o.getxC()) {
				r = 1;
			}
			if (this.xC < o.getxC()) {
				r = -1;
			}

		}

		return r;
	}

	public int match(int x, int y) {

		int m = -1;

		if (this.xC == -1 && this.yC == -1) {
			m = 0;

		} else if (this.yC == -1&&this.xC == x) {

				m = 0;

		} else if (this.xC == -1&&this.yC == y) {

				m = 0;

		} else {
			m = compareTo(new CellStyle(x, y));
		}
		return m;

	}

}
